const parame = {
	ios: {
		'meituan': '423084029',
		'dianping': '351091731',
		'gaode': '461703208',
		'weixin': '836500024',
		'douyin': '1142110895',
	},
	android: {
		'meituan': 'com.sankuai.meituan',
		'dianping': 'com.dianping.v1',
		'gaode': 'com.autonavi.minimap',
		'weixin': 'com.tencent.mm',
		'douyin': 'com.ss.android.ugc.aweme',
	}
}

const scheme = {
	"apple": "itms-appss://apps.apple.com/cn/app/id", // 苹果
	"huawei": "appmarket://details?id=", // 华为
	"vivo": "vivoMarket://details?id=", // Vivo
	"oppo": "market://details?id=", // oppo
	"xiaomi": "mimarket://details?id=", // 小米
	"oneplus": "oneplusstore://app/", // 一加
	"samsung": "samsungapps://ProductDetail/", // 三星
	"meizu	": "mstore://details?package_name=", // 魅族
	"lenovo": "http://market.lenovomm.com/details?id=", // 联想
	"tmast": "tmast://appdetails?pname=", // 应用宝  直接下载
	"anzhi": "anzhimarket://details?id=", // 安智市场
}

const judgeBrand = function(sUserAgent) {
	console.log('======,,..', sUserAgent)
	var isIphone = sUserAgent.match(/iphone/i) == 'iphone';
	var isHuawei = sUserAgent.match(/huawei/i) == 'huawei';
	var isHonor = sUserAgent.match(/honor/i) == 'honor';
	var isOppo = sUserAgent.match(/oppo/i) == 'oppo';
	var isOppoR15 = sUserAgent.match(/pacm00/i) == 'pacm00';
	var isVivo = sUserAgent.match(/vivo/i) == 'vivo';
	var isXiaomi = sUserAgent.match(/mi\s/i) == 'mi ';
	var isXiaomired = sUserAgent.match(/xiaomi/i) == 'xiaomi';
	var isXiaomi2s = sUserAgent.match(/mix\s/i) == 'mix ';
	var isRedmi = sUserAgent.match(/redmi/i) == 'redmi';
	var isSamsung = sUserAgent.match(/sm-/i) == 'sm-';
	var isLG = sUserAgent.match(/lg/i) == 'lg';
	var isOneplus = sUserAgent.match(/oneplus/i) == 'oneplus';
	var isOneplus9 = sUserAgent.match(/le/i) == 'le';
	var isMeizu = sUserAgent.match(/meizu/i) == 'meizu';

	if (isIphone) {
		return 'apple';
	} else if (isHuawei || isHonor) {
		return 'huawei';
	} else if (isOppo || isOppoR15) {
		return 'oppo';
	} else if (isVivo) {
		return 'vivo';
	} else if (isXiaomi || isRedmi || isXiaomi2s || isXiaomired) {
		return 'xiaomi';
	} else if (isSamsung) {
		return 'samsung';
	} else if (isLG) {
		return 'LG';
	} else if (isOneplus) {
		return 'oneplus';
	} else if (isMeizu) {
		return 'meizu';
	} else {
		return '其他型号手机';
	}
}

export default {
	parame,
	scheme,
	judgeBrand
}